<style>
    a:link {
        color: teal;
    }

    /* 未访问链接 */
    a:visited {
        color: purple;
    }

    /* 已访问链接 */
    a:hover {
        background: yellow;
    }

    /* 用户鼠标悬停 */
    a:active {
        color: red;
    }

    /* 激活链接 */

    p:active {
        background: #eee;
    }

    /* 激活段落 */
</style>
<p>This paragraph contains a link:<br />
    <a href="#">This link will turn red while you click on it.</a>
    The paragraph will get a gray background while you click on it or the link.
</p>